body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background: #f9f9f9;
}

.match-list {
    overflow-y: auto;
    max-width: 100%;
    overflow-x: auto;
    display: flex;
    justify-content: center;
    /* 水平居中 match-item */
    flex-wrap: wrap;
    /* 允许换行 */
    justify-content: center;
    /* 居中每行的 item */
    gap: 10px;
    /* 可选：item 间距 */
    padding: 10px;
}

.match-item {
    margin: 0 auto;
    /* 水平居中 */
    background: #fff;
    padding: 15px;
    margin-bottom: 0px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    display: grid;
    grid-gap: 10px;
    align-items: center;
    /* 宽度加大 */
    width: max-content;
    /* 宽度自适应内容，不限制最大宽度 */
    min-width: 1400px;
    /* 可以设置最小宽度，保证不挤 */
    grid-template-columns: 140px 200px 300px 240px 240px 240px 240px;
    /* 主客队列宽度改为300px */
}

.time-score {
    text-align: center;
}

.time {
    font-weight: bold;
    font-size: 16px;
}

.score {
    margin-top: 5px;
    font-size: 20px;
    color: #2a7ae2;
}

.league {
    font-size: 14px;
    color: #666;
}

.teams {
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    /* 防止换行 */
    overflow: visible !important;
    text-overflow: ellipsis;
    /* 超出部分显示省略号 */
    display: flex;
    flex-direction: column;
    text-align: center;

}

.handicap-group,
.overunder-group {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 75px;
    /* 3盘口，每盘口大约25px高度 */
}

.handicap-row,
.overunder-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 2px 5px;
    border-bottom: 1px solid #eee;
}

.handicap-row:last-child,
.overunder-row:last-child {
    border-bottom: none;
}

.handicap-label,
.overunder-label {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 12px;
    color: #888;
}

.handicap-group,
.overunder-group {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 75px;
}

.handicap-row,
.overunder-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 2px 5px;
    border-bottom: 1px solid #eee;
}

.handicap-row:last-child,
.overunder-row:last-child {
    border-bottom: none;
}

/* 给每个盘口数据设置等宽，三列均分 */
.handicap-row>span,
.overunder-row>span {
    flex: 1;
    text-align: center;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-bar label {
    font-size: 14px;
    color: #333;
}

.filter-bar select,
.filter-bar input {
    padding: 4px 8px;
    font-size: 14px;
}

#league-select-btn {
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
}

.league-popup {
    position: absolute;
    top: 50px;
    left: 10px;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    z-index: 100;
}

.league-popup.hidden {
    display: none;
}

.league-list {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 8px;
    margin-bottom: 10px;
}

.team.home {
    font-weight: bold;
}

.team.away {
    color: #666;
}

.odds-item {
    border-radius: 4px;
    background-color: #f2f2f2;
    margin-right: 2px;
}

.odds-item.secondary {
    color: #999;
    background-color: transparent;
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: max-content;
    max-width: 300px;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    text-align: center;
    padding: 5px 10px;
    border-radius: 4px;

    /* 定位 */
    position: absolute;
    z-index: 10;
    bottom: 125%;
    /* 上方显示 */
    left: 50%;
    transform: translateX(-50%);

    /* 渐显效果 */
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    /* 避免遮挡鼠标 */
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* 三角形指示器 */
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    /* 三角形在tooltip底部 */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.75) transparent transparent transparent;
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 12px 16px;
    margin-top: 10px;
    border-radius: 4px;
    position: relative;
    min-width: 200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}